<?php

  class ancien_c extends CI_Controller
  {

    public function __construct()
    {
      parent:: __construct();

      $this->lang->load("etudiant","french");

      $this->load->model('ancien_m');
      $this->load->model('promotion_m');

      $this->load->helper("url");
      $this->load->helper('language');
      $this->load->helper('form');
    
      $this->load->library("pagination");
      $this->load->library('table');

     // $this->load->liste_ancien();
    }

    function index()
    {
      //$this->load->ancien_annuaire();
    }

    public function ancien_annuaire()
    {
      $message = 'Annuaire des anciens';
      
      $config = array();
      $config["base_url"] = base_url(). "ancien_c/ancien_annuaire";
      $config["total_rows"] = $this->ancien_m->calcul_ancien();
      $config["per_page"] = 30;
      $config["uri_segment"] = 3;
     
      $this->pagination->initialize($config);
      
      $start = ($this->uri->segment(3)) ? $this->uri->segment(3) : 1;
      $data["result"] = $this->ancien_m->getByPage($config["per_page"],$start);
      $data["links"] = $this->pagination->create_links();
      $data["message"] = $message;

      $this->load->view('ancien/ancien_annuaire',$data);
    }
  }
   
?>